package twoD.Csg;

import inf.v3d.obj.*;
import inf.v3d.view.Viewer;

public class QuadTree {

	private QuadTreeNode root;
	private CsgNode N;

	public QuadTree(CsgNode N, double ox, double oy, double size, int depth) {
		this.N = N;
		this.root = new QuadTreeNode(N, ox, oy, size);
		this.root.refine(N, depth);
	}

	public void draw(boolean ov, int cm, Viewer v) {
		PolygonSet ps = new PolygonSet();
		this.root.draw(N, ps);
		ps.setColoringByData(true);
		ps.setOutlinesVisible(ov);
		ps.setColorMode(cm);
		ps.createColors();
		v.addObject3D(ps);
	}
}
